import { requestClient } from '#/api/request';

export namespace LogApi {
  /** 日志列表参数 */
  export interface LogListParams {
    username?: string;
    current_page: number;
    page_size: number;
  }

  /** 日志列表项 */
  export interface LogItem {
    id: string;
    createTime: string;
    type: string;
    content: string;
    operator: string;
  }

  /** 日志列表返回结果 */
  export interface LogListResult {
    items: LogItem[];
    total: number;
  }
}

/**
 * 获取日志列表
 */
export function getLogListApi(params: LogApi.LogListParams) {
  return requestClient.post<LogApi.LogListResult>('/v1/log/list', params);
}
